package com.company;

import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;

public class monsys {
    private JTextField textField1;
    private JButton 查询Button;
    private JTable table1;
    private JPanel panel1;
    private DefaultTableModel table3;
    private Object[][] data;
    private String[] total={"assets"};

    public monsys() {
        JFrame mon=new JFrame("财产管理");
        mon.setSize(400,400);
        mon.add(panel1);
        mon.setLocation(400,250);
        mon.setVisible(true);
        查询Button.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                String gongyu=textField1.getText();
                ZSGC zs=new ZSGC();
                try {
                    table3.addRow(zs.chazhao1(gongyu));
                } catch (SQLException ex) {
                    ex.printStackTrace();
                }
            }
        });
    }

    public static void main(String[] args) {
        monsys mo=new monsys();
    }
    private void createUIComponents() {
        // TODO: place custom component creation code here
        data=null;
        table3=new DefaultTableModel(data,total);
        table1 = new JTable(table3);
    }
}
